home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tttdem51.zip / STRNDEM2.PAS < prev    next >
Pascal/Delphi Source File  |  1989-01-31  |  2KB  |  59 lines

  1. Program StrnTTT5_Demo_2;
  2. {$V-}
  3.  
  4. uses CRT, FastTTT5, ReadTTT5, WinTTT5, StrnTTT5;
  5.  
  6. var
  7.     Ch : char;
  8.     DemoStr : string;
  9.  
  10.      Procedure Output_Strings;
  11.      {}
  12.      begin
  13.          FBox(1,1,80,15,yellow,blue,2);
  14.          WriteCenter(2,lightcyan,blue,'"'+DemoStr+'"');
  15.          WriteAt(3,4,lightgray,blue,'Upper:');
  16.          WriteAt(30,4,yellow,blue,'"'+Upper(DemoStr)+'"');
  17.          WriteAt(3,5,lightgray,blue,'Lower:');
  18.          WriteAt(30,5,yellow,blue,'"'+Lower(DemoStr)+'"');
  19.          WriteAt(3,6,lightgray,blue,'Proper:');
  20.          WriteAt(30,6,yellow,blue,'"'+Proper(DemoStr)+'"');
  21.          WriteAt(3,7,lightgray,blue,'Total words:');
  22.          WriteAt(30,7,lightgreen,blue,Int_To_Str(WordCnt(DemoStr)));
  23.          WriteAt(3,8,lightgray,blue,'Posn. Word 3:');
  24.          WriteAt(30,8,lightgreen,blue,Int_to_Str(PosWord(3,DemoStr)));
  25.          WriteAt(3,9,lightgray,blue,'Words 2..5 are:');
  26.          WriteAt(30,9,yellow,blue,'"'+ExtractWords(2,4,DemoStr)+'"');
  27.          WriteAt(3,10,lightgray,blue,'Strip Leading spaces:');
  28.          WriteAt(30,10,yellow,blue,'"'+Strip('L',' ',DemoStr)+'"');
  29.          WriteAt(3,11,lightgray,blue,'Strip Trailing spaces:');
  30.          WriteAt(30,11,yellow,blue,'"'+Strip('R',' ',DemoStr)+'"');
  31.          WriteAt(3,12,lightgray,blue,'Strip Lng. & Tng. spaces:');
  32.          WriteAt(30,12,yellow,blue,'"'+Strip('B',' ',DemoStr)+'"');  
  33.          WriteAt(3,13,lightgray,blue,'Strip All spaces:');
  34.          WriteAt(30,13,yellow,blue,'"'+Strip('A',' ',DemoStr)+'"');
  35.      end; {of proc Output_Strings}
  36.  
  37.  
  38.  
  39. begin
  40.     Clrscr;
  41.     DemoStr := '  TechnoJock''s Turbo Toolkit string demo   ';
  42.     OutPut_Strings;
  43.     With RTTT do
  44.     begin
  45.         EraseDefault := true;
  46.     end;
  47.     Repeat
  48.          Read_String(20,18,48,'^ Enter a new string or ESC ',1,DemoStr);
  49.          If R_Char <> #027 then
  50.             OutPut_Strings;
  51.     until R_Char = #027;
  52.  
  53.     WriteAT(1,20,white,black,'Run DemoTTT.exe for the main demo program');
  54.     WriteAT(1,21,white,black,'TechnoJock''s Turbo Toolkit v5.0');
  55.     GotoXY(1,22);
  56. end.
  57.  
  58.  
  59.